package com.lq.eureka;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageListener;
import org.springframework.amqp.rabbit.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class MqReceiver  {



    @RabbitListener(bindings = @QueueBinding(
             value =@Queue("computerorder"),
            key = "computer",
            exchange =@Exchange("exchange")
    ))
    public void process(String msg) {
         System.out.println(" computer msg  is:"+msg);
    }



    @RabbitListener(bindings = @QueueBinding(
            value =@Queue("fruitorder"),
            key = "fruits",
            exchange =@Exchange("exchange")
    ))
    public void process2(String msg) {
        System.out.println("fruits msg  is:"+msg);
    }

}
